/**
 * yuhaitao 2017-07-18
 */

require.config({
paths:{
		'hprose':'../base/hprose',
		'config':'../logic/config'
	}
});
define(['hprose','config'],function (hprose,config) {
	methods=["AccountController_getUserInfo","AccountController_getAddressStr","AccountController_agreeProtocol","AccountController_bindPhone","AccountController_bindPhoneV2","AccountController_setFirstBoxShowed","AccountController_setUserInfo","AccountController_sendSmsCode","AccountController_setUserNC","AccountController_getUserStatus","FeedBackController_setQuestionCache","FeedBackController_getMedicationSituation","FeedBackController_giveSuggest","FeedBackController_submitFeedBackInfo","FeedBackController_submitFeedbackPhotos","FeedBackController_getFeedBackQuestions","FeedBackController_uploadMedicineImage","FeedBackController_setStartTime","FeedBackController_setUsedDays","FeedBackController_getFeedbackStatus","FeedBackController_showSelectBox","FeedBackController_getReportInfo","FeedBackController_getQuestionCache","ResourceController_comment","ResourceController_getComments","ResourceController_browsingHistoryArticle","ResourceController_getGroups","ResourceController_browsingHistoryBbs","ResourceController_getBbsesNew","ResourceController_getClassDetail","ResourceController_recommendArticles","ResourceController_getArticleDetail","ResourceController_getArticles","ResourceController_classSignUp","ResourceController_myBbses","ResourceController_getClassesSignedup","ResourceController_getClassesHistory","ResourceController_getMainPageInfo","ResourceController_post","ResourceController_getBbsesHot","ResourceController_getBbsDetail","ResourceController_getClasses","ResourceController_like","UserScoreController_getScoreItems","UserScoreController_luckDraw","UserScoreController_getUserIntegral","UserScoreController_getIntegralStatus"];
	var defaultErrorProcessFunc = function (error) {
		config.defaultErrorFunc(error);
		hiddenLoading();
	}
	var client = hprose.Client.create(config.serverUrl, methods);
	return {
		AccountController_getUserInfo : function (token, success, faile){
			//获取用户信息
			client.AccountController_getUserInfo(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		AccountController_getAddressStr : function (token, longitude, latitude, success, faile){
			//通过经纬度获取地址信息
			client.AccountController_getAddressStr(token, longitude, latitude, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		AccountController_agreeProtocol : function (token, success, faile){
			//设置同意用户协议
			client.AccountController_agreeProtocol(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		AccountController_bindPhone : function (token, phone, code, success, faile){
			//绑定手机
			client.AccountController_bindPhone(token, phone, code, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		AccountController_bindPhoneV2 : function (token, phone, code, name, sex, address, success, faile){
			//绑定手机设置用户信息
			client.AccountController_bindPhoneV2(token, phone, code, name, sex, address, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		AccountController_setFirstBoxShowed : function (token, success, faile){
			//设置已显示过首次弹窗
			client.AccountController_setFirstBoxShowed(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		AccountController_setUserInfo : function (token, name, sex, age, address, success, faile){
			//设置用户信息
			client.AccountController_setUserInfo(token, name, sex, age, address, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		AccountController_sendSmsCode : function (token, phone, success, faile){
			//发送短信验证码
			client.AccountController_sendSmsCode(token, phone, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		AccountController_setUserNC : function (token, nickName, sid, success, faile){
			//设置用户昵称和头像
			client.AccountController_setUserNC(token, nickName, sid, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		AccountController_getUserStatus : function (token, success, faile){
			//获取用户状态
			client.AccountController_getUserStatus(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		FeedBackController_setQuestionCache : function (token, type, cacheString, success, faile){
			//设置用户反馈表缓存
			client.FeedBackController_setQuestionCache(token, type, cacheString, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		FeedBackController_getMedicationSituation : function (token, success, faile){
			//获取用户用药情况信息
			client.FeedBackController_getMedicationSituation(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		FeedBackController_giveSuggest : function (token, suggestion, success, faile){
			//提交意见反馈
			client.FeedBackController_giveSuggest(token, suggestion, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		FeedBackController_submitFeedBackInfo : function (token, type, submitInfos, success, faile){
			//提交反馈表答案
			client.FeedBackController_submitFeedBackInfo(token, type, submitInfos, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		FeedBackController_submitFeedbackPhotos : function (token, type, mediaids, success, faile){
			//上传用户反馈表照片
			client.FeedBackController_submitFeedbackPhotos(token, type, mediaids, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		FeedBackController_getFeedBackQuestions : function (token, type, success, faile){
			//获取反馈表
			client.FeedBackController_getFeedBackQuestions(token, type, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		FeedBackController_uploadMedicineImage : function (token, mediaId, success, faile){
			//微信web上传药品信息图片
			client.FeedBackController_uploadMedicineImage(token, mediaId, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		FeedBackController_setStartTime : function (token, startTime, success, faile){
			//设置用药开始时间
			client.FeedBackController_setStartTime(token, startTime, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		FeedBackController_setUsedDays : function (token, usedDays, success, faile){
			//设置已用药天信息
			client.FeedBackController_setUsedDays(token, usedDays, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		FeedBackController_getFeedbackStatus : function (token, success, faile){
			//获取用户反馈变填写状态
			client.FeedBackController_getFeedbackStatus(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		FeedBackController_showSelectBox : function (token, success, faile){
			//当日是否弹出选框
			client.FeedBackController_showSelectBox(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		FeedBackController_getReportInfo : function (token, success, faile){
			//获取患者自报告信息
			client.FeedBackController_getReportInfo(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		FeedBackController_getQuestionCache : function (token, type, success, faile){
			//获取用户反馈表缓存
			client.FeedBackController_getQuestionCache(token, type, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_comment : function (token, relateid, type, replyCommentid, content, success, faile){
			//评论
			client.ResourceController_comment(token, relateid, type, replyCommentid, content, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_getComments : function (token, id, type, success, faile){
			//获取评论列表
			client.ResourceController_getComments(token, id, type, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_browsingHistoryArticle : function (token, success, faile){
			//文章浏览历史
			client.ResourceController_browsingHistoryArticle(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_getGroups : function (success, faile){
			//获取论坛模块列表
			client.ResourceController_getGroups(function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_browsingHistoryBbs : function (token, success, faile){
			//论坛浏览历史
			client.ResourceController_browsingHistoryBbs(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_getBbsesNew : function (token, success, faile){
			//获取最新论坛列表
			client.ResourceController_getBbsesNew(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_getClassDetail : function (token, cid, success, faile){
			//获取课程详情
			client.ResourceController_getClassDetail(token, cid, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_recommendArticles : function (token, id, success, faile){
			//获取推荐文章列表
			client.ResourceController_recommendArticles(token, id, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_getArticleDetail : function (token, id, success, faile){
			//获取文章详情
			client.ResourceController_getArticleDetail(token, id, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_getArticles : function (token, success, faile){
			//获取文章列表
			client.ResourceController_getArticles(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_classSignUp : function (token, cid, success, faile){
			//课程报名
			client.ResourceController_classSignUp(token, cid, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_myBbses : function (token, success, faile){
			//获取我的论坛
			client.ResourceController_myBbses(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_getClassesSignedup : function (token, success, faile){
			//获取已报名课程列表
			client.ResourceController_getClassesSignedup(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_getClassesHistory : function (token, success, faile){
			//获取听课历史
			client.ResourceController_getClassesHistory(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_getMainPageInfo : function (token, success, faile){
			//获取首页信息
			client.ResourceController_getMainPageInfo(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_post : function (token, title, content, gid, mediaids, success, faile){
			//发帖
			client.ResourceController_post(token, title, content, gid, mediaids, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_getBbsesHot : function (token, success, faile){
			//获取最热论坛列表
			client.ResourceController_getBbsesHot(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_getBbsDetail : function (token, bid, success, faile){
			//获取论坛详情
			client.ResourceController_getBbsDetail(token, bid, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_getClasses : function (token, success, faile){
			//获取课程列表
			client.ResourceController_getClasses(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		ResourceController_like : function (token, bid, success, faile){
			//点赞/取消点赞
			client.ResourceController_like(token, bid, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		UserScoreController_getScoreItems : function (token, success, faile){
			//获取积分记录
			client.UserScoreController_getScoreItems(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		UserScoreController_luckDraw : function (token, success, faile){
			//抽奖
			client.UserScoreController_luckDraw(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		UserScoreController_getUserIntegral : function (token, success, faile){
			//获取用户总积分
			client.UserScoreController_getUserIntegral(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		},
		UserScoreController_getIntegralStatus : function (token, success, faile){
			//获取抽奖积分状态
			client.UserScoreController_getIntegralStatus(token, function(result){
				if(result.code != 0){
					faile==undefined? defaultErrorProcessFunc(result):faile(result);
					hiddenLoading();
				}else{
					success(result.result);
					hiddenLoading();
				}
			},faile == undefined? defaultErrorProcessFunc:faile);
		}
	}
});
